package com.link.base.base.enterprise.dao.mybatis.mapper;

import com.link.base.basic.model.ListOfValue;
import com.link.base.base.enterprise.model.Enterprise;
import com.link.base.base.duty.model.DutyMenu;
import com.link.base.base.enterprise.model.PartTable;
import com.link.core.basic.dao.BasicDaoException;
import com.link.core.basic.dao.mapper.BasicMapper;
import com.link.core.basic.model.CallParam;

import java.util.List;

/**
 * 企业管理
 *
 * @author l update 18.11.05
 * @date 18.11.05
 */
public interface EnterpriseMapper extends BasicMapper<Enterprise> {

    /**
     * 添加二维码图片
     *
     * @param record
     * @throws Exception
     */
    public void qrCodeImageUpdate(Enterprise record) throws Exception;

    /**
     * 初始化企业
     * @param record
     * @throws Exception
     */
    public void initializeCompany(CallParam record) throws Exception;

    /**
     * 删除企业
     * @param record
     * @throws Exception
     */
    public void deleteCompany(CallParam record) throws Exception;

    /**
     * <p>企点</p>
     * 第三方授权信息更新
     *
     * @param record
     * @throws Exception
     */
    public void qidianAuthUpdate(Enterprise record) throws Exception;

    /**
     * <p>企点</p>
     * 更新授权方的接口调用凭证
     *
     * @param record
     * @throws Exception
     */
    public void authAccessTokenUpdate(Enterprise record) throws Exception;

    /**
     * 查询所有关联了企点的企业
     * @param entity
     * @return List
     * @throws Exception
     */
    public List<Enterprise> queryQidianEnt(Enterprise entity) throws Exception;

    /**
     * 获取启用严格安全模式的账套编码数组
     *
     * @return String[]
     */
    public String[] getCorpidsWhichActiveStrictSeurityMode();

    /**
     * 更新企业认证图片
     *
     * @param enterprise
     * @throws BasicDaoException
     */
    public void updateVoucherImg(Enterprise enterprise) throws BasicDaoException;

    /**
     * 根据corpid获取企业信息
     *
     * @author : LiQun
     * @param code 用户corpid
     * @return 企业信息
     * @throws Exception 异常
     * @date : 下午3:25 2018/5/22
     */
    public Enterprise getEnterpriseInfo(Long code) throws Exception;

    /***
     * 更新企业对账单参数
     * @param enterprise
     * @throws Exception
     */
    public void updateBillStatementParam(Enterprise enterprise) throws Exception;

    /**
     * 查询指定条件参数下的企业数据
     * 可扩展
     *
     * @param enterprise
     * @return list
     * @throws Exception
     */
    public List<Enterprise> queryAllByAssCondition(Enterprise enterprise) throws Exception;

    /**
     * 特定条件下获取企业信息
     * @param enterprise
     * @return List
     */
    public List<Enterprise> getEnterpriseByUserCode(Enterprise enterprise);

    /**
     * 查询是否存在分区表
     * @param partTable
     * @return list
     * @throws Exception
     */
    public List<PartTable> queryExistPartTable(PartTable partTable) throws Exception;

    /**
     * 查询当前表是否有p开头的分区
     * @param entity
     * @return PartTable
     * @throws Exception
     */
    public PartTable queryCountPart(PartTable entity) throws Exception;

    /**
     * 查询是否存在当前编号的分区
     * @param entity
     * @return PartTable
     * @throws Exception
     */
    public PartTable queryExistNamePart(PartTable entity) throws Exception;

    /**
     * 查询表的最大分区和分区依据列
     * @param entity
     * @return PartTable
     * @throws Exception
     */
    public PartTable queryMaxPart(PartTable entity) throws Exception;

    /**
     * 新建表分区
     * @param partTable
     * @throws Exception
     */
    public void addNewPart(PartTable partTable) throws Exception;

    /**
     * 删除某账套下所有值列表
     * @param record
     * @throws Exception
     */
    public void deleteAllListOfVal(CallParam record) throws Exception;

    /**
     * 查询出所有没有父的值列表
     * @param lov
     * @return list
     * @throws Exception
     */
    public List<ListOfValue> queryNoParValList(ListOfValue lov) throws Exception;

    /**
     * 查询子值列表
     * @param entity
     * @return list
     * @throws Exception
     */
    public List<ListOfValue> queryChildListByParVal(ListOfValue entity) throws Exception;

    /**
     * 删除某账套职位用户数据
     * @param record
     * @throws Exception
     */
    public void deleteUserPostn(CallParam record) throws Exception;

    /**
     * 为默认用户添加默认职位
     * @param record
     * @throws Exception
     */
    public void insertUserPostn(CallParam record) throws Exception;

    /**
     * 删除某账套的职责数据
     * @param record
     * @throws Exception
     */
    public void deleteCorpDuty(CallParam record) throws Exception;

    /**
     * 为当前账套插入默认职责
     * @param record
     * @throws Exception
     */
    public void insertCorpDuty(CallParam record) throws Exception;

    /**
     * 删除某账套的用户职责数据
     * @param record
     * @throws Exception
     */
    public void deleteUserDuty(CallParam record) throws Exception;

    /**
     * 为当前账套插入默认职责给默认用户
     * @param record
     * @throws Exception
     */
    public void insertUserDuty(CallParam record) throws Exception;

    /**
     * 删除某账套的app职责数据
     * @param record
     * @throws Exception
     */
    public void deleteAppRole(CallParam record) throws Exception;

    /**
     * 为当前账套插入app职责
     * @param record
     * @throws Exception
     */
    public void insertAppRole(CallParam record) throws Exception;

    /**
     * 删除某账套的职责菜单
     * @param record
     * @throws Exception
     */
    public void deleteDutyMenu(CallParam record) throws Exception;

    /**
     * 为当前账套插入职责菜单
     * @param record
     * @throws Exception
     */
    public void insertDutyMenu(CallParam record) throws Exception;

    /**
     * 删除某账套的app菜单数据
     * @param record
     * @throws Exception
     */
    public void deleteAppRoleAuth(CallParam record) throws Exception;

    /**
     * 为当前账套插入app菜单
     * @param record
     * @throws Exception
     */
    public void insertAppRoleAuth(CallParam record) throws Exception;

    /**
     * 删除某账套的app职责菜单数据
     * @param record
     * @throws Exception
     */
    public void deleteAppRoleMenu(CallParam record) throws Exception;

    /**
     * 为当前账套插入app职责菜单
     * @param record
     * @throws Exception
     */
    public void insertAppRoleMenu(CallParam record) throws Exception;

    /**
     * 为当前账套更新app职责菜单
     * @param record
     * @throws Exception
     */
    public void updateAppRoleMenu(CallParam record) throws Exception;

    /**
     * 批量插入值列表
     * @param lovList
     * @throws Exception
     */
    public void insertListOfValue(List<ListOfValue> lovList) throws Exception;

    /**
     * 查询000账套所选择职责下所有菜单
     * @param record
     * @return List
     * @throws Exception
     */
    public List<DutyMenu> queryDutyMenu(CallParam record) throws Exception;

    /**
     * 插入选择职责下所有菜单
     * @param dutyMenuList
     * @throws Exception
     */
    public void insertDutyMenuList(List<DutyMenu> dutyMenuList) throws Exception;

}
